import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path:'/',
    redirect: '/home/index',  // 重定向:重新指向其它path,会改变网址
  },
  {
    path: '/home',
    name: 'Home',
    component: ()=>import('../views/Home.vue'),
    children:[
      {
        path:'/home/index',
        component:()=>import('../views/home/index.vue')
      },
      {
        path:'/home/shop',
        component:()=>import('../views/home/shop.vue')
      },
      {
        path:'/home/my',
        component:()=>import('../views/home/my.vue')
      },
      {
        path:'/home/clissify',
        component:()=>import('../views/home/clissify.vue')
      }
    ]
  },
  
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
